<?php
/****
* 基本上只对制定个人调用，故无需考虑Account表
*/
class UserMark extends ViewModel{
    protected $viewFields = array( 
        'EventMark'=>array('_type'=>'LEFT',
                    //'_on'=>'Event.id= EventMark.eid',
                    '*',
        ),
        'Event'=>array('_type'=>'LEFT',
                    '_on'=>'EventMark.eid=Event.id',
                    'id'=>'id',
                    'title'=>'title',
                    'img'=>'img',
                    'visibility'=>'visibility',
                    'time_start'=>'time_start',
                    'time_end'=>'time_end',
        ),
    );
    private $uid;
    public function UserMark($uid){
        parent::__construct();
        $this->uid= $uid;
    }
    /****
    * 每次查找操作前设定uid
    */
    protected function _options_filter(&$options) {
        if (! is_null($this->uid)){
            $options['where']['uid']=$this->$uid;
        }
    }
}
?>